package cn.edu.hbvtc.qms.domain;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "course")
public class Course implements Serializable {

	private static final long serialVersionUID = 1L;
	private int id;
	private String courseId;// 课程编号
	private String courseName;// 课程名称
	private int hours;// 学时
	private int courseType;// 课程类型：1表示专业课，2表示公共课
	private int credit;// 学分
	private Major major;// 所属专业
	private Set<ClazzArrangement> clazzArrangement;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@Column
	public String getCourseId() {
		return courseId;
	}

	public void setCourseId(String courseId) {
		this.courseId = courseId;
	}

	@Column
	public String getCourseName() {
		return courseName;
	}

	public void setCourseName(String courseName) {
		this.courseName = courseName;
	}

	@Column
	public int getHours() {
		return hours;
	}

	public void setHours(int hours) {
		this.hours = hours;
	}

	@Column
	public int getCourseType() {
		return courseType;
	}

	public void setCourseType(int courseType) {
		this.courseType = courseType;
	}

	@Column
	public int getCredit() {
		return credit;
	}

	public void setCredit(int credit) {
		this.credit = credit;
	}

	@ManyToOne
	@JoinColumn(name = "major_id")
	public Major getMajor() {
		return major;
	}

	public void setMajor(Major major) {
		this.major = major;
	}

	@OneToMany(mappedBy = "course")
	public Set<ClazzArrangement> getClazzArrangement() {
		return clazzArrangement;
	}
	
	public void setClazzArrangement(Set<ClazzArrangement> clazzArrangement) {
		this.clazzArrangement = clazzArrangement;
	}
}
